<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: aruntime/src/main/java/nars/io/ExperienceReader.java Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d3/d26/ExperienceReader_8java_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ExperienceReader.java</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../d3/d26/ExperienceReader_8java.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * ExperienceReader.java</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2008  Pei Wang</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * This file is part of Open-NARS.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * Open-NARS is free software; you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * the Free Software Foundation, either version 2 of the License, or</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * Open-NARS is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * along with Open-NARS.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="../../db/d64/namespacenars_1_1io.html">   21</a></span>&#160;<span class="keyword">package </span>nars.io;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">import</span> java.awt.FileDialog;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">import</span> java.io.*;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">import</span> <a class="code" href="../../d7/d81/namespacenars.html">nars</a>.<a class="code" href="../../de/ddc/namespacenars_1_1storage.html">storage</a>.<a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader.html">   31</a></span>&#160;<span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader.html">ExperienceReader</a> <span class="keyword">implements</span> <a class="code" href="../../df/dd9/interfacenars_1_1io_1_1InputChannel.html">InputChannel</a> {</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">   34</a></span>&#160;    <span class="keyword">private</span> <a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../dd/da5/classnars_1_1storage_1_1Memory_1_1ReasonerBatch.html">ReasonerBatch</a> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ab159e433cfda44807825df9a4e32c2a6.html#ab159e433cfda44807825df9a4e32c2a6">   36</a></span>&#160;    <span class="keyword">private</span> BufferedReader <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ab159e433cfda44807825df9a4e32c2a6.html#ab159e433cfda44807825df9a4e32c2a6">inExp</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a550c2b8a25ce59d79d1e27d5ea314944.html#a550c2b8a25ce59d79d1e27d5ea314944">   39</a></span>&#160;    <span class="keyword">private</span> <span class="keywordtype">int</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a550c2b8a25ce59d79d1e27d5ea314944.html#a550c2b8a25ce59d79d1e27d5ea314944">timer</a>;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a65f89f1299c14e572cd5b770f28f085b.html#a65f89f1299c14e572cd5b770f28f085b">   47</a></span>&#160;    <span class="keyword">public</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a65f89f1299c14e572cd5b770f28f085b.html#a65f89f1299c14e572cd5b770f28f085b">ExperienceReader</a>(<a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../dd/da5/classnars_1_1storage_1_1Memory_1_1ReasonerBatch.html">ReasonerBatch</a> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>) {</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        this.<a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a> = <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        inExp = null;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    }</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f3c8bc8f7309340a49f51ff680811dd.html#a9f3c8bc8f7309340a49f51ff680811dd">   53</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f3c8bc8f7309340a49f51ff680811dd.html#a9f3c8bc8f7309340a49f51ff680811dd">openLoadFile</a>() {</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        FileDialog dialog = <span class="keyword">new</span> FileDialog((FileDialog) null,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                <span class="stringliteral">&quot;Load experience&quot;</span>, FileDialog.LOAD);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        dialog.setVisible(<span class="keyword">true</span>);</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        String directoryName = dialog.getDirectory();</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        String fileName = dialog.getFile();</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        String filePath = directoryName + fileName;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f3c8bc8f7309340a49f51ff680811dd.html#a9f3c8bc8f7309340a49f51ff680811dd">openLoadFile</a>(filePath);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    }</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f50480e5784c1ecb2d9295c851c2af7.html#a9f50480e5784c1ecb2d9295c851c2af7">   69</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f50480e5784c1ecb2d9295c851c2af7.html#a9f50480e5784c1ecb2d9295c851c2af7">openLoadFile</a>(String filePath) {</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            inExp = <span class="keyword">new</span> BufferedReader(<span class="keyword">new</span> FileReader(filePath));</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        } <span class="keywordflow">catch</span> (IOException ex) {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            System.out.println(<span class="stringliteral">&quot;i/o error: &quot;</span> + ex.getMessage());</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>.addInputChannel(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ad4a37e15e01b21a566e0d04ad00fa978.html#ad4a37e15e01b21a566e0d04ad00fa978">   81</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ad4a37e15e01b21a566e0d04ad00fa978.html#ad4a37e15e01b21a566e0d04ad00fa978">closeLoadFile</a>() {</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            inExp.close();</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        } <span class="keywordflow">catch</span> (IOException ex) {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            System.out.println(<span class="stringliteral">&quot;i/o error: &quot;</span> + ex.getMessage());</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        }</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>.removeInputChannel(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a1e4529d4f692ecfc7becd9d8e367b3d6.html#a1e4529d4f692ecfc7becd9d8e367b3d6">   90</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a1e4529d4f692ecfc7becd9d8e367b3d6.html#a1e4529d4f692ecfc7becd9d8e367b3d6">setBufferedReader</a>(BufferedReader inExp) {</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        this.inExp = <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ab159e433cfda44807825df9a4e32c2a6.html#ab159e433cfda44807825df9a4e32c2a6">inExp</a>;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>.addInputChannel(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a1a4b66a6e6cf89d5c2ea7a5923195247.html#a1a4b66a6e6cf89d5c2ea7a5923195247">  101</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">boolean</span> <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a1a4b66a6e6cf89d5c2ea7a5923195247.html#a1a4b66a6e6cf89d5c2ea7a5923195247">nextInput</a>() {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="keywordflow">if</span> (timer &gt; 0) {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;            timer--;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        }</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="keywordflow">if</span> (inExp == null) {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        String line = null;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="keywordflow">while</span> (timer == 0) {</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                line = inExp.readLine();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                <span class="keywordflow">if</span> (line == null) {</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;                    inExp.close();</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                    inExp = null;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                }</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            } <span class="keywordflow">catch</span> (IOException ex) {</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                System.out.println(<span class="stringliteral">&quot;i/o error: &quot;</span> + ex.getMessage());</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;            }</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            line = line.trim();</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            <span class="comment">// read NARS language or an integer</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            <span class="keywordflow">if</span> (line.length() &gt; 0) {</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                    timer = Integer.parseInt(line);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                    <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>.walk(timer);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                } <span class="keywordflow">catch</span> (NumberFormatException e) {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                    <a class="code" href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">reasoner</a>.textInputLine(line);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                }</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;            }</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        }</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    }</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;}</div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_ab159e433cfda44807825df9a4e32c2a6_html_ab159e433cfda44807825df9a4e32c2a6"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ab159e433cfda44807825df9a4e32c2a6.html#ab159e433cfda44807825df9a4e32c2a6">nars.io.ExperienceReader.inExp</a></div><div class="ttdeci">BufferedReader inExp</div><div class="ttdoc">Input experience from a file. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00036">ExperienceReader.java:36</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_html"><div class="ttname"><a href="../../d8/df4/classnars_1_1storage_1_1Memory.html">nars.storage.Memory</a></div><div class="ttdoc">The memory of the system. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l00051">Memory.java:51</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a1a4b66a6e6cf89d5c2ea7a5923195247_html_a1a4b66a6e6cf89d5c2ea7a5923195247"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a1a4b66a6e6cf89d5c2ea7a5923195247.html#a1a4b66a6e6cf89d5c2ea7a5923195247">nars.io.ExperienceReader.nextInput</a></div><div class="ttdeci">boolean nextInput()</div><div class="ttdoc">Process the next chunk of input data TODO duplicated code with InputWindow#nextInput(). </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00101">ExperienceReader.java:101</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a_html_a2360054ef94073abe1df64f06ae20c3a"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a2360054ef94073abe1df64f06ae20c3a.html#a2360054ef94073abe1df64f06ae20c3a">nars.io.ExperienceReader.reasoner</a></div><div class="ttdeci">Memory.ReasonerBatch reasoner</div><div class="ttdoc">Reference to the reasoner. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00034">ExperienceReader.java:34</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a9f3c8bc8f7309340a49f51ff680811dd_html_a9f3c8bc8f7309340a49f51ff680811dd"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f3c8bc8f7309340a49f51ff680811dd.html#a9f3c8bc8f7309340a49f51ff680811dd">nars.io.ExperienceReader.openLoadFile</a></div><div class="ttdeci">void openLoadFile()</div><div class="ttdoc">Open an input experience file with a FileDialog. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00053">ExperienceReader.java:53</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a550c2b8a25ce59d79d1e27d5ea314944_html_a550c2b8a25ce59d79d1e27d5ea314944"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a550c2b8a25ce59d79d1e27d5ea314944.html#a550c2b8a25ce59d79d1e27d5ea314944">nars.io.ExperienceReader.timer</a></div><div class="ttdeci">int timer</div><div class="ttdoc">Remaining working cycles before reading the next line. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00039">ExperienceReader.java:39</a></div></div>
<div class="ttc" id="interfacenars_1_1io_1_1InputChannel_html"><div class="ttname"><a href="../../df/dd9/interfacenars_1_1io_1_1InputChannel.html">nars.io.InputChannel</a></div><div class="ttdoc">An interface to be implemented in all input channels to get the input for the next moment from an inp...</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d99/InputChannel_8java_source.html#l00026">InputChannel.java:26</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a9f50480e5784c1ecb2d9295c851c2af7_html_a9f50480e5784c1ecb2d9295c851c2af7"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a9f50480e5784c1ecb2d9295c851c2af7.html#a9f50480e5784c1ecb2d9295c851c2af7">nars.io.ExperienceReader.openLoadFile</a></div><div class="ttdeci">void openLoadFile(String filePath)</div><div class="ttdoc">Open an input experience file from given file Path. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00069">ExperienceReader.java:69</a></div></div>
<div class="ttc" id="namespacenars_1_1storage_html"><div class="ttname"><a href="../../de/ddc/namespacenars_1_1storage.html">nars.storage</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d6/dce/Bag_8java_source.html#l00021">Bag.java:21</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_ad4a37e15e01b21a566e0d04ad00fa978_html_ad4a37e15e01b21a566e0d04ad00fa978"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_ad4a37e15e01b21a566e0d04ad00fa978.html#ad4a37e15e01b21a566e0d04ad00fa978">nars.io.ExperienceReader.closeLoadFile</a></div><div class="ttdeci">void closeLoadFile()</div><div class="ttdoc">Close an input experience file (close the reader in fact) </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00081">ExperienceReader.java:81</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a65f89f1299c14e572cd5b770f28f085b_html_a65f89f1299c14e572cd5b770f28f085b"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a65f89f1299c14e572cd5b770f28f085b.html#a65f89f1299c14e572cd5b770f28f085b">nars.io.ExperienceReader.ExperienceReader</a></div><div class="ttdeci">ExperienceReader(Memory.ReasonerBatch reasoner)</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00047">ExperienceReader.java:47</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_a1e4529d4f692ecfc7becd9d8e367b3d6_html_a1e4529d4f692ecfc7becd9d8e367b3d6"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader_a1e4529d4f692ecfc7becd9d8e367b3d6.html#a1e4529d4f692ecfc7becd9d8e367b3d6">nars.io.ExperienceReader.setBufferedReader</a></div><div class="ttdeci">void setBufferedReader(BufferedReader inExp)</div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00090">ExperienceReader.java:90</a></div></div>
<div class="ttc" id="namespacenars_html"><div class="ttname"><a href="../../d7/d81/namespacenars.html">nars</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_1_1ReasonerBatch_html"><div class="ttname"><a href="../../dd/da5/classnars_1_1storage_1_1Memory_1_1ReasonerBatch.html">nars.storage.Memory.ReasonerBatch</a></div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l00853">Memory.java:853</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1ExperienceReader_html"><div class="ttname"><a href="../../d7/d69/classnars_1_1io_1_1ExperienceReader.html">nars.io.ExperienceReader</a></div><div class="ttdoc">To read and write experience as Task streams. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00031">ExperienceReader.java:31</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_ed82ebcd34e530b246c6fd9032262140.html">aruntime</a></li><li class="navelem"><a class="el" href="../../dir_19496ddff8e6c0f2b6654287ecb1a472.html">src</a></li><li class="navelem"><a class="el" href="../../dir_db9c5934f797909f7296c2c2017f7fc9.html">main</a></li><li class="navelem"><a class="el" href="../../dir_6d74390eb6d6287951075e525bcb9bed.html">java</a></li><li class="navelem"><a class="el" href="../../dir_51a24984472456d47100350cd31f9a7c.html">nars</a></li><li class="navelem"><a class="el" href="../../dir_aab9dfc51d7cf7443c970bdaa3292fa7.html">io</a></li><li class="navelem"><a class="el" href="../../d3/d26/ExperienceReader_8java.html">ExperienceReader.java</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:58 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
